<!DOCTYPE html>
<html lang="en" xmlns:text-aglin="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="../layui/css/layui.css" tppabs="https://res.layui.com/layui/dist/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>

<script src="../layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->

<body>

<form class="layui-form" action="/add">
    <div class="layui-form-item">
        <label class="layui-form-label">国家</label>
        <div class="layui-input-inline">
            <input type="text" name="country" value="中国" readonly="readonly" required  lay-verify="required" placeholder="请输入国家" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">省份</label>
        <div class="layui-input-inline">
            <input type="text" name="province" required  lay-verify="required" placeholder="请输入省份" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">患者姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="patientName" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">确诊类型</label>
        <div class="layui-input-inline">
            <select name="patientType" lay-verify="required">
                <option value="">请选择</option>
                <option value="1">密接</option>
                <option value="2">无症状</option>
                <option value="3">时空伴随</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">患者状态</label>
        <div class="layui-input-inline">
            <select name="patientState" lay-verify="required">
                <option value="">请选择</option>
                <option value="1">重症</option>
                <option value="2">治愈</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">确诊时间</label>
            <div class="layui-input-inline">
                <input type="text" name="createTime" id="createTime" lay-verify="datetime" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>


<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            /*layer.msg(JSON.stringify(data.field));*/
            //前端的可以写一些校验，比如：js验证等..
            return true;//true：才会走action
        });
    });
</script>
</body>

<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#createTime',
            type : 'datetime'
        });

    });
</script>


</html>